package cmdrunner;

import java.io.*;

public class Main {

	public Main() {

		try {
		    
			Process p = Runtime.getRuntime().exec("cmd /c find /i \"http://es.wikipedia.org/wiki\" C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Local\\Microsoft\\Windows\\History\\History.IE5\\index.dat| sort > C:\\Users\\"+System.getProperty("user.name")+"\\workspace\\LIAM\\historialdenavegacion.txt");
		//dir /s /a "\places.sqlite"
			p.waitFor();
			
			p.getOutputStream();
			
			BufferedReader reader = new BufferedReader(new InputStreamReader(
					p.getInputStream()));
			String line = reader.readLine();
			while (line != null) {
				System.out.println(line);
				line = reader.readLine();
			}

		} catch (IOException e1) {
		} catch (InterruptedException e2) {
		}

		System.out.println("Done");

	}

	public static void main(String[] args) {

		try {
		
			Process p = Runtime.getRuntime().exec("cmd /c find /i \"http://es.wikipedia.org/wiki\" C:\\Users\\"+System.getProperty("user.name")+"\\AppData\\Local\\Microsoft\\Windows\\History\\History.IE5\\index.dat| sort > C:\\Users\\"+System.getProperty("user.name")+"\\workspace\\LIAM\\historialdenavegacion.txt");
		
			p.waitFor();
			BufferedReader reader = new BufferedReader(new InputStreamReader(
					p.getInputStream()));
			String line = reader.readLine();
			while (line != null) {
				System.out.println(line);
				line = reader.readLine();
			}

		} catch (IOException e1) {
		} catch (InterruptedException e2) {
		}

		System.out.println("Done");

	}

}
